package com.springspirit.framework.message;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;

public class CepMessage implements Serializable{

	// TODO: 에러 메시지 포맷을 어떻게 정해야 할까?
	// 1. 로그인 사용자
	// 2. 로그인 IP Address
	// 3. 서브시스템(모듈)별
	// 4. 메뉴별
	// 5. 담당자별
	// 6. Layer별 (Controller, Service, Dao)
	// 7. 에러 유형별(SQLException, SystemException, BizException, and so on)
	// 8. 에러 메시지

	/**
	 * 
	 */
	private static final long serialVersionUID = 8871534238622711338L;
	
	private String count;
	
	private String errorCategory;
	
	private String timeStamp;

	public String getCount() {
		return count;
	}

	public void setCount(String count) {
		this.count = count;
	}

	public String getErrorCategory() {
		return errorCategory;
	}

	public void setErrorCategory(String errorCategory) {
		this.errorCategory = errorCategory;
	}
	
	public String getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(String timeStamp) {
		this.timeStamp = timeStamp;
	}

	public CepMessage() {
	};
	
	public CepMessage(String errorCategory) {
		this.errorCategory = errorCategory;
	}

	public CepMessage(String count, String errorCategory, String timeStamp) {
		this.count = count;
		this.errorCategory = errorCategory;
		this.timeStamp = timeStamp;
	}
	
	@Override
	public String toString() {

		return ToStringBuilder.reflectionToString(this);
	}
	
	public Map toMap(){
		Map map = new HashMap();
		map.put("count", count);
		map.put("errorCategory", errorCategory);
		map.put("timeStamp", timeStamp);
		
		return map;
	}

}
